* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

/*  ------------------------ General Reset and Layout ------------------------ */
html,
body {
  margin: 0;
  padding: 0;
  background-color: white;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  height: 100%;
  display: flex;
  flex-direction: column;
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.references-link {
  text-decoration: none;
}

/* ------------------------ Navigation Bar ------------------------ */

#navigation {
  position: static;
  background-color: black;
  padding: 30px 30px;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.no-transition {
  transition: none !important;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  color: white;
  font-weight: bold;
  font-size: 130%;
  text-decoration: none;
  margin-left: 50px;
  z-index: 1001;
}

.nav-right {
  margin-right: 50px;
  font-size: 110%;
}

.nav-right .social-links {
  display: none;
}

.nav-right a {
  color: white;
  margin-left: 30px;
  text-decoration: none;
}

.nav-right a:hover {
  text-decoration: underline;
}

#open-menu,
#close-menu {
  display: none;
}

.mobile-only {
  display: none;
}

/* ------------------------ Main container grows to push footer down ------------------------ */

main {
  flex: 1;
  opacity: 0;
  animation: fadeIn 0.5s ease-in-out forwards;
  animation-delay: 0.2s;
}

/* ------------------------ Landing Page ------------------------ */

.landing-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#about-me {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  box-sizing: border-box;
  flex: 1;
}

/* Left column */
.image-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 40px;
  text-align: center;
  padding-right: 40px;
  border-right: 2px solid black; /* vertical divider */
}

.image-column .profile-pic {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border: 1px solid black;
  transition: 0.3s;
}

.image-column .social-links {
  display: none;
}

.image-column .social-links img {
  width: 35px !important;
  height: 35px !important;
  border: none;
  margin: 0;
}

.name {
  font-weight: bold;
  font-size: 130%;
  margin-top: 10px;
  text-align: center;
}

.subtitle {
  font-size: 100%;
  color: #444444;
  margin-top: 15px;
  text-align: center;
  line-height: 1.5;
}

/* Right column */
.bio-column {
  max-width: 700px;
  padding-left: 40px;
}

.bio-column h2 {
  font-size: 250%;
  margin-top: 0;
  text-align: left;
}

.bio-column p {
  font-size: 120%;
  line-height: 1.6;
  text-align: justify;
}

/* About me text container */
#about-me > div:last-child {
  max-width: 700px;
  text-align: left;
}

#about-me a:hover {
  text-decoration: underline;
}

/* ------------------------ Footer ------------------------ */
footer {
  position: static;
  background-color: black;
  color: white;
  text-align: center;
  padding: 20px 30px;
  font-size: 90%;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

footer a {
  color: white;
  text-decoration: underline;
}

/* ------------------------ Animations ------------------------ */

@keyframes slide-in {
  from {
    left: -100%;
  }
  to {
    left: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ------------------------ Teaching page styles ------------------------ */
.teaching-main {
  font-size: 90%;
  padding: 60px;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
}

.teaching-main section {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.teaching-main h1 {
  text-align: center;
  margin-bottom: 0px;
}

/* Institution heading */
.teaching-main h2 {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ccc;
  padding-bottom: 6px;
  flex-wrap: wrap;
  margin-top: 40px;
  display: flex;
  align-items: center;
  --level: 0;
  margin-left: calc(var(--level) * 20px);
}

/* Academic year */
.teaching-main h3 {
  color: #003366;
  font-weight: normal;
  margin: 5px 0 15px 0;
  --level: 1;
  margin-left: calc(var(--level) * 20px);
}

/* Course title */
.teaching-main h4 {
  margin-bottom: 6px;
  --level: 2;
  margin-left: calc(var(--level) * 20px);
}

/* List of activities */
.teaching-main ul {
  margin: 0 0 15px 0;
  padding-left: 20px;
  --level: 3;
  margin-left: calc(var(--level) * 20px);
}

.teaching-main a:hover {
  text-decoration: underline;
}

/* Institution logo */
.institution-logo {
  height: 28px;
  width: auto;
  margin-right: 10px;
}

/* ------------------------ Research page styles ------------------------ */
.research-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  font-size: 90%;
  padding: 60px;
  box-sizing: border-box;
  width: 100%;
  overflow-y: auto;
  margin: 0 auto;
}

.research-main section {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.research-main h1 {
  text-align: center;
  margin-bottom: 0px;
}

/* Institution heading */
.research-main h2 {
  text-align: center;
  margin-top: 40px;
  border-bottom: 1px solid #ccc;
  padding-bottom: 6px;
}

.research-main h3 {
  color: #003366;
  font-weight: normal;
  margin-bottom: -15px;
}

.research-main h4 {
  font-style: italic;
  margin-bottom: -10px;
}

.research-main a:hover {
  text-decoration: underline;
}

.toggleAbstract:hover {
  text-decoration: underline;
}

.abstractText {
  text-align: justify;
}

:root {
  /* Fallback; will be overwritten by JS with the real footer height */
  --footer-h: 70px;
}

/* ------------------------ Social links ------------------------ */

.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 10px;
}

.social-links img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
}

.social-links img:hover {
  transform: scale(1.1); /* 110% on hover */
}

/* ------------------------ Media queries ------------------------ */

@media (max-width: 1200px) {
  .image-column {
    border-right: none;
    padding-right: 0px;
    margin-right: 0px;
  }
}

@media (max-width: 1000px) {
  #navigation {
    padding: 20px 20px;
  }
  #about-me {
    gap: 40px;
  }

  #about-me {
    flex-direction: column;
    text-align: center;
    height: auto;
    padding: 20px;
  }

  #about-me div {
    text-align: center;
  }

  .name {
    margin-top: 0px;
  }

  .subtitle {
    margin-top: 10px;
  }

  .bio-column {
    padding-left: 0px;
  }

  .bio-column h2 {
    font-size: 130%;
  }

  .bio-column p {
    font-size: 100%;
  }

  .nav-left {
    font-size: 110%;
    margin-left: 0;
  }

  .nav-right {
    font-size: 100%;
    margin-right: 20px;
  }

  .social-links {
    display: none;
  }

  .image-column .profile-pic {
    margin-right: 0;
    margin-bottom: 20px;
    width: 180px;
    height: 180px;
  }

  .image-column .social-links {
    display: flex;
    gap: 18px !important;
    margin-top: 5px;
  }

  .nav-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    position: fixed;
    gap: 10px;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 0;
    z-index: 1000;
    transition: 0.5s ease-in-out;
  }

  .nav-active {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-right a {
    padding: 2px 0;
    margin: 0;
    font-size: 102%;
  }

  #open-menu {
    display: block;
  }

  #close-menu {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
  }

  .mobile-only {
    display: block;
  }

  .research-main {
    font-size: 70%;
    padding: 30px;
  }

  .teaching-main {
    font-size: 70%;
    padding: 30px;
  }

  footer {
    font-size: 70%;
    padding: 10px 20px;
  }
}

@media (max-width: 768px) {
  .social-links {
    gap: 20px;
  }

  .bio-column p {
    font-size: 90%;
  }

  .subtitle {
    font-size: 100%;
  }
}

@media (max-width: 480px) {
  .image-column .social-links {
    gap: 18px !important;
  }

  .image-column .profile-pic {
    width: 160px;
    height: 160px;
  }

  .bio-column p {
    font-size: 80%;
  }

  .subtitle {
    font-size: 90%;
  }

  #about-me {
    gap: 20px;
  }
}

@media (max-width: 300px) {
  .image-column .social-links img {
    width: 25px !important;
    height: 25px !important;
  }
}

@media (max-height: 450px) {
  .image-column .profile-pic {
    width: 120px;
    height: 120px;
  }
}
